import request from '@/utils/request'

const BASE_URL = process.env.VUE_APP_BASE_URL

export function pageRole(params) {
  return request({
    url: `${BASE_URL}/web/v1/role/roleListByPage`,
    method: 'get',
    params: params
  })
}
export function getAllRole(params) {
  return request({
    url: `${BASE_URL}/web/v1/role/getRoleList`,
    method: 'get',
    params: params
  })
}
//角色详情
export function getRoleDetail(id) {
  return request({
    url: `${BASE_URL}/web/v1/role/roleDetail/`+id,
    method: 'get'
  })
}
//新增角色
export function insertRole(data) {
  return request({
    url: `${BASE_URL}/web/v1/role/addRole`,
    method: 'post',
    data
  })
}
//修改角色
export function updateRole(data) {
  return request({
    url: `${BASE_URL}/web/v1/role/updRole`,
    method: 'post',
    data
  })
}
//删除角色
export function deleteRole(data) {
  return request({
    url: `${BASE_URL}/web/v1/role/deleteRole`,
    method: 'post',
    data
  })
}






